Msg("Musik is from the Opensource game Vega Strike, Credit to the Orginal Authors")

-- local Soundlist = {"Freelancer/space_ambience.mp3", 	--space peace sound
-- "Freelancer/mission_complete.mp3",						--winnsound
-- "Freelancer/populated_station_dock.mp3",				--bigstationsound
-- "Freelancer/died.mp3",									--diedsound
-- "Freelancer/ship_largescale_battle.mp3"					--boss fight
-- ,"Freelancer/ship_medium_battle.mp3"					--npc fight normal
-- ,"Freelancer/defencesystem_battle.mp3"					--pvp station
-- ,"Freelancer/mine_field.mp3"							--in minefield
-- ,"Freelancer/ship_small_battle.mp3"						--pvp space
-- ,"Freelancer/tradestation_ambience.mp3"					--big station
-- ,""
-- ,"populated_station_dock.mp3"}													--small station

-- for k, Sound in pairs (Soundlist) do
-- resource.AddFile("sound/".. Sound )
-- end

function AcualizeMusic(ply)
	local plyuni = ply:UniqueID()
	if ply.died then
		ply:ConCommand("ChangeTrack 4 true")
		ply.died = false
		servertable["ply"][plyuni]["InNpcFight"] = false
		ply.infight = false
		return
	end
	if servertable["ply"][plyuni]["InStation"] then
		if ply.infight then
			ply:ConCommand("ChangeTrack " .. 6 )
			return
		else
			if servertable["ply"][plyuni]["InBigStation"] then	
				ply:ConCommand("ChangeTrack " .. 10 )
				return
			else
				ply:ConCommand("ChangeTrack " .. 11 )
				return
			end
		end
	else
		if ply.infight then
			if servertable["ply"][plyuni]["InNpcFight"] then
				if (ply.sector == 123) then --(123 must be the number of the bosssector)
					ply:ConCommand("ChangeTrack " .. 5 )
					return
				else
					ply:ConCommand("ChangeTrack " .. 7 )
					return
				end
			else
				ply:ConCommand("ChangeTrack " .. 9 )
				return
			end
		else
			if ply.inminefield then
				ply:ConCommand("ChangeTrack " .. 8 )
				return
			else
				ply:ConCommand("ChangeTrack " .. 1 )
				return
			end
		end	
	end
end
concommand.Add( "AcualizeMusic", AcualizeMusic ) 